package com.tianzehua.jvm.classloader;

import java.lang.reflect.Method;

/**
 * @author tianzehua
 * @date 2019/04/02
 */
public class MyTest17 {

    public static void main(String[] args)  throws Exception{

        MyTest13 loader1 = new MyTest13("loader1");
        MyTest13 loader2 = new MyTest13("loader1");

        Class<?>  clazz1 = loader1.loadClass("com.tianzehua.jvm.classloader.MyPerson");
        Class<?>  clazz2 = loader2.loadClass("com.tianzehua.jvm.classloader.MyPerson");

        System.out.println(clazz1 == clazz2);

        Object object1 =clazz1.newInstance();
        Object object2 =clazz2.newInstance();

        Method method = clazz1.getMethod("setMyPerson",Object.class);
        method.invoke(object1,object2);





    }
}
